package com.example.designpatterns.creational.builder;

/**
 * @author zuitu@foxmail.com
 * @date 2024/1/18
 */
public class BurgerBuilder {
    private int size;
    private boolean cheese;
    private boolean pepperoni;
    private boolean lettuce;
    private boolean tomato;

    public BurgerBuilder(int size) {
        this.size = size;
    }

    public BurgerBuilder setCheese() {
        this.cheese = true;
        return this;
    }

    public BurgerBuilder setPepperoni() {
        this.pepperoni = true;
        return this;
    }

    public BurgerBuilder setLettuce() {
        this.lettuce = true;
        return this;
    }

    public BurgerBuilder setTomato() {
        this.tomato = true;
        return this;
    }

    public int getSize() {
        return size;
    }

    public boolean getCheese() {
        return cheese;
    }

    public boolean getPepperoni() {
        return pepperoni;
    }

    public boolean getLettuce() {
        return lettuce;
    }

    public boolean getTomato() {
        return tomato;
    }

    public Burger build() {
        return new Burger(this);
    }
}
